﻿    using Domain.Entitys.Inv;
    using Microsoft.EntityFrameworkCore;
    using Microsoft.EntityFrameworkCore.Metadata.Builders;
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;

    namespace EFCore.EntityConfigurations.Inv
    {
        public class Inv_ProddtiConfiguration : IEntityTypeConfiguration<inv_proddti>
        {
            public void Configure(EntityTypeBuilder<inv_proddti> builder)
            {
                builder.ToTable("inv_proddti");
                builder.HasKey(e =>e.Proddti_id);

                builder.HasOne(e =>e.Main)
                       .WithMany(e => e.Details)
                       .HasForeignKey(e => e.Qty_id);
            }
        }
    }
